<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    function f1(num){
        var odd=0,even=0;
        for(var i=0;i<num.length;i++){
            if(num[i]%2==0){
                even++;
            }
            else{
                odd++
            }
        }
        console.log("function f1:")
        console.log("奇数个数："+odd)
        console.log("偶数个数："+even)
        return [odd,even]
    }
    function f2(num){
        var sum=0;
        for(var i=0;i<num.length;i++){
            if(num[i]%2==0&&num[i]%3==0){
                sum+=num[i];
            }
        }
        console.log("function f2:")
        console.log("被2和3整除的数求和为："+sum)
        return sum
    }
    function f3(arr){
        arr.sort();
        console.log("function f3:")
        console.log("最大值："+arr[arr.length-1])
        console.log("最小值："+arr[0])
    }
    function f4(arr1,arr2){
        if(arr1.length!=arr2.length){
            console.log("function f4:")
            console.log("false")
            return ;
        }
        for(var i=0;i<arr1.length;i++){
            if(arr1[i]!=arr2[i]){
            console.log("function f4:")
            console.log("false")
            return ;
        }
        console.log("function f4:")
        console.log("true")
    }}
    function f5(arr){
        arr.sort();
        console.log("function f5:")
        console.log("最大值："+arr[arr.length-1])
        console.log("次大值："+arr[arr.length-2])
    }
    function f6(arrAnswer,arr){
        var score=0;
        for(var i=0;i<arrAnswer.length;i++){
            if(arrAnswer[i]==arr){
                score+=2;
            }
        }
        console.log("function f6:")
        console.log("最终得分为："+score)
    }
    function f7(arr){
        var score=0;
        arr.sort();
        for(var i=1;i<arr.length-1;i++){
            score+=arr[i];
        }
        score=score/(arr.length-2)
        console.log("function f7:")
        console.log("最终成绩为："+score)
    }
    
</script>
</html>